<% @edit_perm = has_permission?("Postgres:edit", @pg)
@page_title = @pg.name

tabs = [
  ["Overview", "overview", "hero-squares-plus"],
  ["Connection", "connection", "plug-disconnected"],
  ["Metrics", "charts", "hero-chart-pie"],
  ["Networking", "networking", "hero-globe-alt"]
]

unless @pg.read_replica?
  tabs.push(
    ["Resize", "resize", "hero-arrow-top-right-on-square"],
    ["High Availability", "high-availability", "hero-square-2-stack-modified"],
    ["Read Replica", "read-replica", "read-replica"],
    ["Backup/Restore", "backup-restore", "hero-circle-stack"],
    ["Upgrade", "upgrade", "hero-cloud-arrow-up"]
  )
end

tabs.push(
  ["Configuration", "config", "hero-document-text"],
  ["Settings", "settings", "hero-cog-8-tooth"]
) %>

<%== part("object/show",
  object: @pg,
  tabs:,
  type: "postgres",
  breadcrumb_label: "PostgreSQL Databases",
  right_header: part("components/pg_state_label", state: @pg.display_state, extra_class: "text-md")
) %>
